module.exports = function(grunt) {

    require('time-grunt')(grunt);
     require('load-grunt-tasks')(grunt);

    // 项目配置
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            options: {
                separator: ';'
            },
            dist: {
                src: ['js/**/*.js','js/RouterApp.js'],
                dest: 'dist/js/hongtu.js'
            }
        },
        uglify: {
            compress: {
                //忽略console
                drop_console: true
            },
            mangle: {
                except: ['$scope', '$provide', '$httpProvider', '$q', '$rootScope', '$routeProvider']
            },
            build: {
                src: 'dist/js/hongtu.js',
                dest: 'dist/js/hongtu.min.js'
            }
        },
        jshint: {
            files:['js/**/*.js'],
            options: {
                reporter: require('jshint-stylish'),
                noempty:false,
                globals: {
                    jQuery: true,
                    console: true,
                    module: true,
                    document: true
                }
            }
          
        }, 
        watch:{
           options: {
                dateFormat: function(time) {
                  grunt.log.writeln('Grunt watch ' + time + 's DONE' + (new Date()).toString());
                  grunt.log.writeln('**********HongTu GOOD JOB**********');
                }
              },
           files:['js/**/*.js'],
           tasks:['concat','jshint','uglify']
       }
    });


    grunt.registerTask('default', ['watch']);

}
